package com.example.demo.server.serciceimpl;

import com.example.demo.bean.User;
import com.example.demo.mapper.LoginMapper;
import com.example.demo.mapper.UserMapper;
import com.example.demo.server.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
//https://www.bilibili.com/video/BV19E411v7Ty?p=9
@Service
public class LoginServiceimpl implements LoginService {

    @Autowired
    private LoginMapper loginMapper;

    @Override
    public User loginaction(String username, String password) {
        System.out.print("日志：：：" + username + password);
        User result = loginMapper.loginaction(username,password);
        if ( null== result||result.equals("")) {
            System.out.print("日志：：：!!!!!!" +"空");
            return result;
        } else {
            System.out.print("日志：：：!!!!!!" + result.getUsername()+result.getUsertel());
            return result;
        }

    }
}
